<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="utf-8">
    <title>用户添加--后台管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" th:href="@{/static/layui/css/layui.css}" media="all"/>
    <style type="text/css">
        .layui-form-item .layui-inline {
            width: 33.333%;
            float: left;
            margin-right: 0;
        }

        @media (max-width: 1240px) {
            .layui-form-item .layui-inline {
                width: 100%;
                float: none;
            }
        }

        .layui-form-item .role-box {
            position: relative;
        }

        .layui-form-item .role-box .jq-role-inline {
            height: 100%;
            overflow: auto;
        }

        .nameTitle {
            font-size: large;
            font-style: inherit;
        }

        .titleSize {
            font-size: 12px;
            font-style: inherit;
        }

        body {
            margin: 0px;
            padding: 0px;
            background-color: #d2d2d2;
        }

        .layui-card {
            margin-top: 10px;
        }

    </style>
</head>
<body>
<div class="layui-container">
    <form class="layui-form">
        <div class="layui-row">
            <div class="layui-row layui-col-space12">
                <div class="layui-col-md10 layui-col-md-offset1">
                    <div class="layui-card">
                        <div class="layui-card-header nameTitle">基本属性:</div>
                        <div class="layui-card-body">
                            <div class="layui-inline">
                                <label class="layui-form-label">用户名</label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" name="loginName" lay-verify="required" placeholder="请输入用户名">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">昵称</label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" name="nickName" placeholder="请输入昵称">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-card">
                        <div class="layui-card-header   nameTitle">访问属性:</div>
                        <div class="layui-card-body">
                            <div class="layui-row">
                                <div class="layui-inline">
                                    <label class="layui-form-label">身份</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="identity" placeholder="请输入身份">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">访问地址</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="requestPlace" placeholder="请输入访问地址">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">手机</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="tel" lay-verify="phone" placeholder="请输入手机号码">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-row" style="margin-top: 5px">
                                <div class="layui-inline">
                                    <label class="layui-form-label">邮箱</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="email" lay-verify="email" placeholder="请输入邮箱">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">年龄</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="age" lay-verify="number" placeholder="请输入年龄">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-card">
                        <div class="layui-card-header   nameTitle">用户令牌:</div>
                        <div class="layui-card-body">
                            <div class="layui-inline">
                                <div class="layui-field-box layui-inline" th:each="role : ${roleList}">
                                    <div class="layui-input-block">
                                        <input type="checkbox" name="roles" th:value="${role.id}" th:title="${role.name}" lay-filter="role"/>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-card">
                        <div class="layui-card-header   nameTitle">其他属性:</div>
                        <div class="layui-card-body">
                            <div class="layui-inline">
                                <label class="layui-form-label">用户类型</label>
                                <div class="layui-input-block">
                                    <input type="checkbox" th:id="adminUser" name="adminUser" th:value="true" lay-filter="adminUser" lay-skin="switch"
                                           value="true"
                                           lay-text="后台用户|前台用户" checked/>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">是否启用</label>
                                <div class="layui-input-block">
                                    <input type="checkbox" th:id="locked" name="locked" th:value="true" lay-skin="switch" lay-filter="locked"
                                           lay-text="启用|停用"
                                           checked>
                                </div>
                            </div>
                        </div>
                    </div>
                    <shiro:hasPermission name="sys:user:add">
                        <div class="layui-form-item">
                            <div class="layui-input-block" style="margin-left: 0px;text-align: center">
                                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                <button class="layui-btn" lay-submit="" lay-filter="addUser">立即提交</button>
                            </div>
                        </div>
                    </shiro:hasPermission>
                </div>

            </div>
        </div>
    </form>
</div>
<script type="text/javascript" th:src="@{/static/layui/layui.js}"></script>
<script type="text/javascript" th:src="@{/static/admin/js/user/userAdd.js}"></script>
</body>
</html>